#pragma once
#include "imedef.h"
#include "datadef.h"

#define MAX_CAND_COUNT	10

typedef vector<wstring> STR_VECTOR;

class CWordsLib
{
public:
	CWordsLib(void);
	virtual ~CWordsLib(void);

	BOOL HasCand()
	{
		if (m_vctCand.size() > 0)
		{
			return TRUE;
		}
		else
		{
			return FALSE;
		}
	}

	void Reset()
	{
		m_vctCand.clear();
		m_wsPreComp = _T("");
	}

	int GetCandWidth()
	{
		return m_nCandWidth;
	}
	POINT *GetCandPos()
	{
		return m_ptCand;
	}

	int GetWordCount();
	void GetCandWord(int nIndex, wstring &wsWord);
	int Query(wstring wsWord);
	void LoadCand(wstring wsWord);

	void NextPage();
	void PrePage();
	BOOL HasNextPage();
	BOOL HasPrePage();

private:
	int CalCandSize(int nCandStyle);

	WORD_INDEX m_vctCand;
	int m_nPageIndex;
	int m_nCandWidth;
	POINT m_ptCand[MAX_CAND_COUNT];
	wstring m_wsPreComp;

};
